package com.simon.nvwo.modules.designerpattern.iterator;

/**
 * 实体类迭代器
 *
 * @author zhaoyiwu
 * @create 2018-03-07 20:48
 **/
public class ChineseFoodIterator implements Iterator{

    String[] foods;

    int position=0;


    public ChineseFoodIterator(String[] foods) {
        this.foods = foods;
    }



    @Override
    public boolean hasNext() {

        return this.position != foods.length;
    }

    @Override
    public Object next() {

        String food=foods[position];

        position+=1;

        return food;
    }

    @Override
    public void remove() {

        //TODO
    }
}
